﻿<UserControl x:Class="TotalSystems.Core.Controls.BaseDefenitionsTreeView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" FontFamily="Tahoma"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:enum="clr-namespace:TotalSystems.Core.Infrastructure"         
             x:Name="uc1"
    mc:Ignorable="d" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Height="500" Width="500" xmlns:my="clr-namespace:TotalSystems.Core.Controls">
    
    <Grid x:Name="LayoutRoot" Background="White" Width="{Binding Width,ElementName=uc1}" Height="{Binding Height,ElementName=uc1}">
        <Grid.RowDefinitions>
            <RowDefinition Height="50"/>
            <RowDefinition />
            <RowDefinition Height="50" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="250"/>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <StackPanel Orientation="Horizontal" Grid.ColumnSpan="2">
            <telerik:RadButton Height="35" Width="35" Name="btnAdd" Command="{Binding AddNode,ElementName=uc1}" FlowDirection="LeftToRight" Cursor="Hand" ToolTipService.ToolTip="اضافه" Canvas.Left="117" Canvas.Top="6" Margin="2" HorizontalAlignment="Left">
                <telerik:RadButton.Content>
                    <!--<ImageBrush ImageSource="/TotalSystems.Resources;component/Images/add-32.png"  />-->
                    <Image Source="/TotalSystems.GResources;component/Images/add-32.png" Height="25" Width="25" HorizontalAlignment="Center"/>
                </telerik:RadButton.Content>
            </telerik:RadButton>
            <telerik:RadButton Height="35" Width="35" Name="btnEdit" Command="{Binding EditNode,ElementName=uc1}" FlowDirection="LeftToRight" Cursor="Hand" Margin="2" ToolTipService.ToolTip="ویرایش">
            <telerik:RadButton.Content>
                <!--<ImageBrush ImageSource="/TotalSystems.Resources;component/Images/add-32.png"  />-->
                    <Image Source="/TotalSystems.GResources;component/Images/edit-32.png" Height="25" Width="25" HorizontalAlignment="Center"/>
                </telerik:RadButton.Content>
        </telerik:RadButton>
            <telerik:RadButton Height="35" Width="35" Name="btnDelete" Command="{Binding DeleteNode,ElementName=uc1}" FlowDirection="LeftToRight" Cursor="Hand" Margin="2" ToolTipService.ToolTip="حذف">
                <telerik:RadButton.Content>
                    <!--<ImageBrush ImageSource="/TotalSystems.Resources;component/Images/add-32.png"  />-->
                    <Image Source="/TotalSystems.GResources;component/Images/delete-32.png" Height="25" Width="25" HorizontalAlignment="Center"/>
                </telerik:RadButton.Content>
            </telerik:RadButton>
            <TextBlock Text="نوع نودها:" VerticalAlignment="Center" Margin="15,0,0,0"/>
            <telerik:RadComboBox Name="radComboBox1" ItemsSource="{Binding NodeModes,ElementName=uc1}" SelectedValue="{Binding NodeMode,ElementName=uc1,Mode=TwoWay}" DisplayMemberPath="NodeModeName" SelectedValuePath="NodeMode" Width="100" Margin="5" Height="23" SelectionChanged="radComboBox1_SelectionChanged">
            </telerik:RadComboBox>
        </StackPanel>
        <telerik:RadTreeView Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Left" Name="radTreeView1" VerticalAlignment="Top"  >
                <telerik:RadTreeViewItem Header="BaseDefinitionTreeView" />
            </telerik:RadTreeView>
        <Grid Name="gridItemsTemplate" DataContext="{Binding SelectedItemCopy,ElementName=uc1}" Grid.Column="1" Grid.Row="1">
            <ContentPresenter Name="cp1"   />
        </Grid>
        <Grid Name="gridEditElements" Visibility="Collapsed" Grid.Column="1" Grid.Row="1" DataContext="{Binding SelectedItem,ElementName=uc1}" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition x:Name="col1" />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <!--<TextBox Grid.Column="1" Height="23" Margin="5,0,5,0" Grid.ColumnSpan="2" />
            <TextBox Grid.Column="1" Height="23" VerticalAlignment="Top" Margin="5,0,5,0"  />-->
        </Grid>
        <StackPanel Grid.Column="1" Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right">
            <telerik:RadButton Height="35" Width="35" Name="btnCancel" Command="{Binding Cancel,ElementName=uc1}" HorizontalAlignment="Right" Cursor="Hand" Margin="2" ToolTipService.ToolTip="ابطال">
                <telerik:RadButton.Content>
                    <!--<ImageBrush ImageSource="/TotalSystems.Resources;component/Images/add-32.png"  />-->
                    <Image Source="/TotalSystems.GResources;component/Images/cancel2-32.png" Height="25" Width="25" HorizontalAlignment="Center"/>
                </telerik:RadButton.Content>
            </telerik:RadButton>
            <telerik:RadButton Height="35" Width="35" Name="btnCommit" Command="{Binding CommitChanges,ElementName=uc1}" HorizontalAlignment="Right"  Cursor="Hand" Margin="2" ToolTipService.ToolTip="انجام تغییرات">
                <telerik:RadButton.Content>
                    <!--<ImageBrush ImageSource="/TotalSystems.Resources;component/Images/add-32.png"  />-->
                    <Image Source="/TotalSystems.GResources;component/Images/success-32.png" Height="25" Width="25" HorizontalAlignment="Center"/>
                </telerik:RadButton.Content>
            </telerik:RadButton>
        </StackPanel>
    </Grid>
</UserControl>
